That way we also get rid of the refresh_index function.
{
GtkCellAccessible *cell;
AtkObject *parent;
- int index;
cell = GTK_CELL_ACCESSIBLE (obj);
if (parent == NULL)
return -1;
- index = _gtk_cell_accessible_parent_get_child_index (GTK_CELL_ACCESSIBLE_PARENT (parent), cell);
- if (index >= 0)
- return index;
-
- if (atk_state_set_contains_state (cell->state_set, ATK_STATE_STALE) &&
- cell->refresh_index != NULL)
- {
- cell->refresh_index (cell);
- atk_state_set_remove_state (cell->state_set, ATK_STATE_STALE);
- }
-
- return cell->index;
+ return _gtk_cell_accessible_parent_get_child_index (GTK_CELL_ACCESSIBLE_PARENT (parent), cell);
}
static AtkStateSet *
{
cell->widget = NULL;
cell->action_list = NULL;
- cell->index = 0;
- cell->refresh_index = NULL;
cell->state_set = atk_state_set_new ();
atk_state_set_add_state (cell->state_set, ATK_STATE_TRANSIENT);
atk_state_set_add_state (cell->state_set, ATK_STATE_ENABLED);
void
_gtk_cell_accessible_initialise (GtkCellAccessible *cell,
GtkWidget *widget,
- AtkObject *parent,
- gint index)
+ AtkObject *parent)
{
cell->widget = widget;
atk_object_set_parent (ATK_OBJECT (cell), parent);
- cell->index = index;
g_signal_connect_object (G_OBJECT (widget), "destroy",
G_CALLBACK (widget_destroyed), cell, 0);
AtkObject parent;
GtkWidget *widget;
- /* This cached value is used only by atk_object_get_index_in_parent()
- * which updates the value when it is stale.
- */
- gint index;
AtkStateSet *state_set;
GList *action_list;
- void (*refresh_index) (GtkCellAccessible *cell);
};
struct _GtkCellAccessibleClass
void _gtk_cell_accessible_initialise (GtkCellAccessible *cell,
GtkWidget *widget,
- AtkObject *parent,
- gint index);
+ AtkObject *parent);
gboolean _gtk_cell_accessible_add_state (GtkCellAccessible *cell,
AtkStateType state_type,
gboolean emit_signal);
_gtk_container_cell_accessible_add_child (GtkContainerCellAccessible *container,
GtkCellAccessible *child)
{
- gint child_index;
-
g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child));
- child_index = container->NChildren++;
+ container->NChildren++;
container->children = g_list_append (container->children, child);
- child->index = child_index;
atk_object_set_parent (ATK_OBJECT (child), ATK_OBJECT (container));
}
container = _gtk_container_cell_accessible_new ();
container_cell = GTK_CELL_ACCESSIBLE (container);
- _gtk_cell_accessible_initialise (container_cell, widget, ATK_OBJECT (accessible), i);
+ _gtk_cell_accessible_initialise (container_cell, widget, ATK_OBJECT (accessible));
/* The GtkTreeViewAccessibleCellInfo structure for the container will
* be before the ones for the cells so that the first one we find for
/* Create the GtkTreeViewAccessibleCellInfo structure for this cell */
cell_info_new (accessible, tree_model, path, tv_col, cell);
- _gtk_cell_accessible_initialise (cell, widget, parent, i);
+ _gtk_cell_accessible_initialise (cell, widget, parent);
/* Set state if it is expandable */
if (is_expander)
/* Create the GtkTreeViewAccessibleCellInfo for this cell */
cell_info_new (accessible, tree_model, path, tv_col, cell);
- _gtk_cell_accessible_initialise (cell, widget, parent, i);
+ _gtk_cell_accessible_initialise (cell, widget, parent);
if (container)
_gtk_container_cell_accessible_add_child (container, cell);